﻿# -*- coding: utf-8 -*-
from google.appengine.ext import webapp
from controllers import *

def main():
        template.register_template_library('filters.myfilter')
        application = webapp.WSGIApplication([('/', MainPage),
                                              ('/all/', AllImagesPage),
                                              ('/rpc/([^/]*)', RPCHandler),
#                                            ('/([^/]+)', GetImageHandler),
                                            ('/entry/new/([^/]*)', NewEntryHandler),
                                            ('/entry/del/([^/]+)', DeleteEntryHandler),
                                            ('/entry/edit/([^/]*)', EditEntryHandler),
                                            ('/reply/new/([^/]*)', NewReplyHandler),
                                            ('/reply/del/([^/]+)', DeleteReplyHandler),
                                            ('/login/', LoginHandler),
                                            ('/logout/', LogoutHandler),
                                            ('/rss/', RssHandler),
                                            ('/flush/', MemcacheHandler),
                                            ('/entry/([^/]+)', GetEntryHandler),
                                            ('/image/([^/]+)', GetImageHandler),
                                            ('/user/([^/]+)', UserPage),
                                            ('/mypage/', MyPage),
                                            ('/test/', TestHandler)
                                         ], debug=True)
        wsgiref.handlers.CGIHandler().run(application)

if __name__ == "__main__":
        main()
